<!--#layout("/common/container.html"){  -->
  <!-- 顶部 -->
<style>
    .layui-layout-admin .layui-logo{
        color:#fff;
    }
    .fsSwitchMenu{
        background-color: #1bb942;
    }
    .notice-dia{
        position: absolute;
        color: #000;
        width: 200px;
        left: -150px;
        border:1px solid #ddd;
        background: #fff;
        top: 62px;
        border-radius: 5px;
        max-height: 250px;
        display: none;
    }
    .notice-dia .notice-title{
        position: relative;
    }
    .notice-dia .notice-title img{
        width: 13px;
        height: 6px;
        position: absolute;
        top: -6px;
        right: 10px;
        z-index: 100;
    }
    .notice-dia h3{
        font-weight: 650;
        font-size: 14px;
        color: #666666;
        line-height: 40px;
        height: 40px;
        padding-left: 20px;
    }
    .notice-dia .no-notice{
        width: 140px;
        height: 120px;
        margin: 0 auto;
    }
    .notice-dia .no-notice .img{
        width: 85px;
        height: 85px;
        margin: 0px 25px;
    }
    .notice-dia .no-text{
        font-size: 14px;
        color: #CCCCCC;
        text-align: center;
        line-height: 18px;
    }
    .notice-dia .check-all{
        height: 18px;
        line-height: 18px;
        text-align: center;
        color: #108DE9;
        font-size: 12px;
        margin: 10px 0;
    }
    .notice-dia .check-all span{
        cursor: pointer;
    }
    .notice-dia ul{
        padding: 0 20px;
        max-height: 172px;
        overflow: auto;
    }
    .notice-dia ul li{
        display: flex;
        margin-top: 20px;
        cursor: pointer;
    }
    .notice-dia ul li .has-read{
        width: 24px;
        height: 26px;
        font-size: 0;
    }
    .notice-dia ul li .notice-content{
        flex: 1;
        line-height: 24px;
        padding-left: 20px;
    }
    .notice-dia ul li .notice-content .notice-content-title{
        font-size: 16px;
    }
    .notice-dia ul li .notice-content .notice-content-content{
        width: 100%;
        overflow: hidden;
        text-overflow:ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .notice-dia ul li .notice-content .notice-content-time{
        font-size: 12px;
        line-height: 18px;
        color: #CCCCCC;
        padding-top: 5px;
    }
</style>
  <form class="layui-form layui-form-pane">
  <div class="layui-header">
    <a href="javascript:;" class="layui-hide-xs"><div class="layui-logo">${env("app.name")}</div></a>
    <a href="javascript:;" class="layui-hide-xs"><div class="fsSwitchMenu"><i class="iconfont icon-category"></i></div></a>
    
    <!-- 顶部菜单 -->
    <ul class="layui-nav layui-layout-left fsTopMenu" id="fsTopMenu" lay-filter="fsTopMenu">
      <!--#for(node in menus.children){  -->
      <li class="layui-nav-item ${nodeLP.first?'layui-this'}" dataPid="${node.data.id}"><a href="javascript:;"><i class="layui-icon">${node.data.icon}</i>
      <!--#if(nodeLP.first){  -->
      <cite>${node.data.name}</cite>
      <!--#}else{  -->
      ${node.data.name}
      <!--#}  -->
      </a></li>
      <!--#} -->
    </ul>
    
    <ul class="layui-nav layui-layout-right"  lay-filter="fsLeftMenu">
       <!-- <li class="layui-nav-item layui-hide-xs">
            &lt;!&ndash;<a href="#" dataUrl="wanke/coreUserMessage/index.do" id="notice" data-title='<i class="layui-icon layui-icon-notice"></i>消息管理'><i class="layui-icon layui-icon-notice"></i>&ndash;&gt;

        &lt;!&ndash;</a>&ndash;&gt;
            &lt;!&ndash;&ndash;&gt;
        <a href="javascript:void(0);" id="notice">
            <i class="layui-icon layui-icon-notice">消息</i>
        </a>
        <div id="dia" class="notice-dia">

        </div>
        </li>-->
      <li class="layui-nav-item layui-hide-xs">
        <a href="javascript:;">
         	${session["core:user"].userName}
        </a>
        <dl class="layui-nav-child">
          <dd id="changeCompanyButton" data-userid="${session['core:user'].id}"><a href="javascript:;">修改密码</a>
          </dd>
        </dl>
      </li>
      <li class="layui-nav-item layui-hide-xs"><a href="/logout.do"><i class="iconfont icon-tuichu"></i> 退出</a></li>
    </ul>
  </div>
  
  <div  id="selectCompany"
  	style="padding: 50px;display:none;">
  	<div class="layui-row">
		<div class="layui-form-item">
			<select id="companyList">
			<!--#
			var allOrgs = session["core:orgs"];
			for(org in allOrgs){
				var checked = false;
				if(session["core:currentOrg"].id==org.id){
					checked=true;
				}
			 -->

		  	<option value="${org.id}" ${checked?"selected"}>${org.name}</option>
		  	<!--#}  -->
		  	</select>
  		</div>
 	 </div>
 	</div>


  <!-- 左边菜单 -->
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="fsLeftMenu" id="fsLeftMenu">
      	<!--#
      	for(node in menus.children){  
      	var hasSite = true;//系统的第一个菜单默认显示
      	-->
      	<!--#for(subSystem in node.children){  -->
          <!--#if(subSystem.data.id ==38 || subSystem.data.id ==47){  -->
            <li class="layui-nav-item" dataPid="${node.data.id}" style="display: none;">
              <a href="javascript:;">${subSystem.data.name}</a>
              <dl class="layui-nav-child">
                <!--#for(menu in subSystem.children){  -->
                <dd class="" ><a href="javascript:void(0);" menuId="${menu.data.id}" dataUrl="${ctxPath}${menu.data.accessUrl}"><i class="layui-icon">&#xe68e;</i>
                ${menu.data.name}
                </a></dd>
                <!--#}  -->
               </dl>
            </li>
          <!--#}else{  -->
              <li class="layui-nav-item layui-nav-itemed" dataPid="${node.data.id}" style="display: none;">
                  <a href="javascript:;">${subSystem.data.name}</a>
                  <dl class="layui-nav-child">
                      <!--#for(menu in subSystem.children){  -->
                      <dd class="" ><a href="javascript:void(0);" menuId="${menu.data.id}" dataUrl="${ctxPath}${menu.data.accessUrl}"><i class="layui-icon">&#xe68e;</i>
                          ${menu.data.name}
                      </a></dd>
                      <!--#}  -->
                  </dl>
              </li>
          <!--#}  -->
        <!--#}  -->
        <!--#}  -->
      </ul>
    </div>
  </div>

  <!-- 右边内容区域 -->
  <div class="layui-body layui-form">
  	<div class="layui-tab layui-tab-card fsTab" lay-filter="fsTab" lay-allowClose="true">
  		
  		<!-- 菜单导航 -->
		<ul class="layui-tab-title">
		 <li class="layui-this">首页</li>
		</ul>
		
		<!-- 内容 -->
		<div class="layui-tab-content">
			<div class="layui-tab-item layui-show">
			<!--#include("/help.html"){}  -->
			</div>
		</div>
	</div>
  </div>
  </form>
<!--#}  -->
<script>
    function openMessage(id,type,objectId) {
        $("#dia").toggle();
        Common.post(Common.ctxPath+"/wanke/coreUserMessage/edit.json","id="+id,function (d) {
            var url='';
            if(type==0){
                url="/CoreNotice/coreNotice/view.do";
            }else{
                url="/wanke/coreApplicationRecord/view.do";
            }
            Common.openDlg(Common.ctxPath+url+"?id="+objectId,"消息详情");
        })
    }
    $(function() {
        <!--Common.post(Common.ctxPath+"/wanke/coreUserMessage/list.json","isRead=0&limit=5",function (list) { //获取未读消息-->
            <!--console.log(list.length)-->
            <!--if(list && list.length>0){-->
                <!--var str = '';-->
                <!--str += "<div class='notice-title'><h3>通知</h3><img src='"+Common.ctxPath+"/images/arrow-top.png'/></div><ul>";-->
                <!--for(var i=0; i<list.length; i++){-->
                    <!--str += "<li onclick='openMessage(" + list[i].id + "," + list[i].type + "," + list[i].objectId + ")'><img class='has-read' src='"+Common.ctxPath+"/images/message.png'>";-->
                    <!--str += "<div class='notice-content'>";-->
                    <!--str += "<p class='notice-content-title'>" + list[i].msg + "</p>";-->
<!--//                    str += "<p class='notice-content-content'>" + list[i].content + "</p>";-->
                    <!--str += "<p class='notice-content-time'>" + list[i].createTime + "</p>";-->
                    <!--str += "</div></li>"-->
                <!--}-->
                <!--str += "</ul><div class='check-all'><a href='javascript:;'  style='color:#000' dataUrl='wanke/coreUserMessage/index.do'>" +-->
                    <!--"查看全部通知</a></div>";-->
                <!--$("#dia").append(str);-->
                <!--$("#notice").html('<i class="layui-icon layui-icon-notice">消息</i><span class="layui-badge-dot"></span>');-->
            <!--}-->
            <!--else{-->
                <!--var str = '';-->
                <!--str += "<div class='notice-title'><h3>通知</h3><img src='"+Common.ctxPath+"/images/arrow-top.png'/></div>";-->
                <!--str += "<div class='no-notice'><img class='img' src='"+Common.ctxPath+"/images/horn.png'/></div>";-->
                <!--str += "<p class='no-text'>暂无通知消息</p>";-->
                <!--str += "<div class='check-all'><a href='javascript:;' style='color:#000' dataUrl='wanke/coreUserMessage/index.do' data-title='<i class=\"layui-icon layui-icon-notice\"></i>消息管理'>" +-->
                    <!--"查看全部通知</a></div>";-->
                <!--$("#dia").append(str);-->
                <!--$("#notice").html('<i class="layui-icon layui-icon-notice">消息</i>');-->
            <!--}-->
        <!--})-->

        function stopBubble(e) {
            e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
        }
        $('#notice').on('click', function(e) {
            $("#dia").toggle();
            e = e || event;
            stopBubble(e);
        });
        $(document).on('click',function(e){
            e = e || event;
            var target = $(e.target);
            if(target.is('#dia *')){
                $('#dia').show();
            }else{
                $('#dia').hide();
            }
            stopBubble(e);
        })
    })
    function closeNotice() {
        $(function() {
            $('#dia').hide();
        })
    }
    function getMessage() {
        var url = "wanke/coreUserMessage/index.do";
        // Common.openDlg50(url,"消息");

    }
</script>

